package set;

import java.util.HashSet;
import java.util.Iterator;

// 底层 HashMap 重复元素会覆盖

public class HashSetT {
    public static void main(String[] args) {
        HashSet<String> set = new HashSet<>();

        set.add("A");
        set.add("B");

        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
